package com.dingreading.cloud.web.service.impl;

import com.dingreading.cloud.web.entity.table.ReadstarUnitTableDef;
import com.mybatisflex.core.query.QueryWrapper;
import com.dingreading.cloud.web.entity.ReadstarUnit;
import com.dingreading.cloud.web.mapper.ReadstarUnitMapper;
import com.dingreading.cloud.web.service.ReadstarUnitService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务层实现。
 *
 * @author Administrator
 * @since 2025-03-31
 */
@Service
public class ReadstarUnitServiceImpl extends BaseServiceImpl<ReadstarUnitMapper, ReadstarUnit, ReadstarUnitTableDef> implements ReadstarUnitService {

    @Override
    protected ReadstarUnitTableDef getTable() {
        return ReadstarUnitTableDef.readstarUnit;
    }

    @Override
    public List<ReadstarUnit> listAll() {
        QueryWrapper wrapper = QueryWrapper.create()
                .orderBy(table.type.asc(), table.showNum.asc());
        return getMapper().selectListByQuery(wrapper);
    }
}
